package com.wy.Service.impl;

import com.wy.dao.ResideDao;
import com.wy.Service.ResideService;
import com.wy.pojo.Reside;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service("resideServer")
@Transactional
public class ResideServerimpl implements ResideService {
    @Resource
    private ResideDao resideDao;

    @Override
    public List<Reside> searchAll() {
        return resideDao.findAll();
    }

    @Override
    public void del(Integer id) {
        resideDao.deleteById(id);
    }


    @Override
    public void add(Reside reside) {
        resideDao.save(reside);
    }
}
